package com.github.ghsea.scheduler.util;

import lombok.extern.slf4j.Slf4j;

/**
 * @author guhai
 * @since 2021/6/19 22:20
 */
@Slf4j
public class RunnableDelegate implements Runnable {

    private Runnable runnable;

    public RunnableDelegate(Runnable runnable) {
        this.runnable = runnable;
    }

    @Override
    public void run() {
        try {
            this.runnable.run();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            throw e;
        }
    }
}
